System and method for supporting optimized buffer utilization for packet processing in a networking device

ABSTRACT

A system and method can support efficient packet processing in a network environment. The system can comprise a direct memory access (DMA) resources pool that comprises one or more of DMA resources. Furthermore, the system can use a plurality of packet buffers in a memory, wherein each said DMA resource can point to a chain of packet buffers in the memory. Here, the chain of packet buffers can be implemented based on either a linked list data structure and/or a linear array data structure. Additionally, each said DMA resource allows a packet processing thread to access the chain of packet buffers using a pre-assigned thread key.

COPYRIGHT NOTICE

A portion of the disclosure of this patent document contains materialwhich is subject to copyright protection. The copyright owner has noobjection to the facsimile reproduction by anyone of the patent documentor the patent disclosure, as it appears in the Patent and TrademarkOffice patent file or records, but otherwise reserves all copyrightrights whatsoever.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is related to the following patent applications, eachof which is hereby incorporated by reference in its entirety:

U.S. Patent Application titled “SYSTEM AND METHOD FOR SUPPORTINGEFFICIENT PACKET PROCESSING MODEL IN A NETWORK ENVIRONMENT”, applicationSer. No. 14/072,566, filed Nov. 5, 2013; and

U.S. Patent Application titled “SYSTEM AND METHOD FOR SUPPORTINGVIRTUALIZED SWITCH CLASSIFICATION TABLES”, application Ser. No.14/072,658, filed Nov. 5, 2013.

FIELD OF INVENTION

The present invention is generally related to computer systems, and isparticularly related to an engineered system for middleware andapplication execution.

BACKGROUND

As larger cloud computing architectures are introduced, the performanceand administrative bottlenecks associated with the traditional networkand storage have become a significant problem. An engineered system,such as the Oracle engineered system, can provide excellent processingspeeds, significantly faster deployments, instant visuals for in-depthanalysis, and manageable big data capability. This is the general areathat embodiments of the invention are intended to address.

SUMMARY

Described herein are systems and methods that can support efficientpacket processing in a network environment. The system can comprise adirect memory access (DMA) resources pool that comprises one or more ofDMA resources. Furthermore, the system can use a plurality of packetbuffers in a memory, wherein each said DMA resource can point to a chainof packet buffers in the memory. Here, the chain of packet buffers canbe implemented based on either a linked list data structure and/or alinear array data structure. Additionally, each said DMA resource allowsa packet processing thread to access the chain of packet buffers using apre-assigned thread key.

BRIEF DESCRIPTION OF THE FIGURES

FIG. 1 shows an illustration of supporting a high performance networkingdevice in a network environment, in accordance with an embodiment of theinvention.

FIG. 2 shows an illustration of supporting an efficient packetprocessing model in a networking device, in accordance with anembodiment of the invention.

FIG. 3 shows an illustration of supporting a packet processing model ina networking device, in accordance with an embodiment of the invention.

FIG. 4 illustrates an exemplary flow chart for supporting efficientpacket processing in a network environment, in accordance with anembodiment of the invention.

FIG. 5 shows an illustration of supporting efficient buffer utilizationfor packet processing in a networking device, in accordance with anembodiment of the invention.

FIG. 6 shows an illustration of using buffer chains for packetprocessing in a networking device, in accordance with an embodiment ofthe invention.

FIG. 7 shows an illustration of using one or more linked lists ofbuffers for packet processing in a networking device, in accordance withan embodiment of the invention.

FIG. 8 shows an illustration of using one or more linear arrays forsupporting packet processing in a networking device, in accordance withan embodiment of the invention.

FIG. 9 shows an illustration of using a mix of linked lists and lineararrays to support flexible packet processing in a networking device, inaccordance with an embodiment of the invention.

FIG. 10 illustrates an exemplary flow chart for supporting efficientbuffer utilization for packet processing in a networking device, inaccordance with an embodiment of the invention.

DETAILED DESCRIPTION

The invention is illustrated, by way of example and not by way oflimitation, in the figures of the accompanying drawings in which likereferences indicate similar elements. It should be noted that referencesto “an” or “one” or “some” embodiment(s) in this disclosure are notnecessarily to the same embodiment, and such references mean at leastone.

The description of the invention as following uses the InfiniBand (IB)network switch as an example for a high performance networking device.It will be apparent to those skilled in the art that other types of highperformance networking devices can be used without limitation.

Described herein are systems and methods that can support multi-threadeddirect memory access (DMA) processing in a network environment. Inaccordance with an embodiment of the invention, the system allows theDMA processing to be flexible and with low memory footprint.

High Performance Networking Device

FIG. 1 shows an illustration of supporting a high performance networkingdevice in a network environment, in accordance with an embodiment of theinvention. As shown in FIG. 1, a high performance networking device 101,such as a network switch, can be used in a network fabric 102 to directpacket flows in a network environment 100.

In accordance with an embodiment of the invention, embedded processors,e.g. DMA engines 110, can be used in the networking device 101 forprocessing packets, such as the packets 121-124 (e.g. including bothcontrol packets and data packets). Here, the transmission and receptionof these packets 121-124 can occur at the network ports 111-112 of thenetworking device 101.

As shown in FIG. 1, the networking device 101 can support a virtualizedfabric. The system allows virtualized applications 108 to run on one ormore virtual machines (VMs) 105-107 that are supported using one or morehost machines 103-104.

Furthermore, when a networking device 101 supports a virtualized fabric,the throughput requirements for processing the control packets 121-124may vary accordingly to the requirement of the different virtualizedapplications 108. As shown in FIG. 1, the network fabric 102 can use thenetworking device 101 to direct multiple packet streams from varioushosts 103-104/VMs 105-107.

In order to support the virtualized applications 108, these differentcontrol packet streams, from various VMs 105-107, can be mapped tohardware resources in the networking device 101 for packet processing.In accordance with an embodiment of the invention, the embeddedprocessors, such as the DMA engines 110, can perform different types ofpacket processing and can run a large number of software threads (orwork queues).

Unlike the DMA engines that run on traditional network interface cards(NICs), which can have substantial CPU capability and system memory, theembedded systems may have limited CPU capability and system memory.Thus, mapping software threads to the hardware resources in the embeddedsystems may incur significant software performance penalties. Forexample, these performance penalties can appear in the form of softwarethread locking overheads, packet buffer management, and other forms,which can further reduce the available CPU capability.

In accordance with an embodiment of the invention, the system canprovide a framework for supporting an efficient packet processing modelin the network environment 100. This framework can map a large number ofsoftware threads to a limited set of hardware DMA processing threadswithout locking and thread contentions. Additionally, the system canoptimize the buffer utilization for packet processing in the networkingdevice 101.

Packet Processing Model

FIG. 2 shows an illustration of supporting efficient packet processingin a networking device, in accordance with an embodiment of theinvention. As shown in FIG. 2, the hardware can provide a free DMAresources pool 210, which contains one or more DMA resources 211-213.

In accordance with an embodiment of the invention, the DMA resources211-213 can represent DMA descriptors, buffer management and DMA enginesused for data movement. For example, the DMA resources 211-213 can betied to one or more DMA engines 220 that represent the physical medium,on which packet transfers can occur.

As shown in FIG. 2, the system can provide an efficient packetprocessing model 200, which can map a large number of software threads202 to a limited set of hardware DMA processing threads 201. The DMAresources 211-213 can be allocated, on-demand, for various softwarethreads 221-229 as needed. Also, the DMA resources 211-213 can bedynamically relinquished by the software threads 221-229.

For example, the DMA resources 211-213 can be assigned according to thedata rate that each DMA Engine can sustain. Here, the assignment of theDMA resources 211-213 may not depend on the number of software threadsworking on a given DMA engine. This is because the traffic processingmay be spread among multiple software threads, and each of thesesoftware threads may be active only for the duration of the workprocessing time.

FIG. 3 shows an illustration of supporting an efficient packetprocessing model in a networking device, in accordance with anembodiment of the invention. As shown in FIG. 3, a thread schedulingengine, such as a thread scheduler 310, can be used to assign adifferent thread key (e.g. key0 311 to key9 319) to each of the softwarethreads 301-309 in a networking device 300. Here, the thread scheduler310 can be built based on a standard real time O/S or a customized O/S.

In accordance with an embodiment of the invention, when a softwarethread requires performing network data transfer, the software threadcan request for accessing a DMA resource by presenting the DMA resourcewith the assigned thread key. As shown in FIG. 3, each software threads301-309 can present a thread key to a resource manager 330, which isused to allocate DMA resources for the different software threads301-309.

For example, the software thread 301 with a thread ID Thid0 can use theassigned thread key, key0 311, to allocate a DMA resource from the DMAresource pool 320. Also, the software thread 302 with a thread ID Thid1can use the assigned thread key, key1 312, to allocate a DMA resourcefrom the DMA resource pool 320. Likewise, the software thread 309 with athread ID Thid9 can use the assigned thread key, key9 319, to allocate aDMA resource from the DMA resource pool 320.

If any DMA resource in the DMA resource pool 320 is free, the availableDMA resource can be assigned to the requesting software thread. Forexample, the assigned DMA resource can be mapped to the assigned threadkey associated with the requesting software thread. On the other hand,if the DMA resource has already been assigned to another softwarethread, the requesting software thread may be prevented (or denied) fromaccessing the DMA resource. Additionally, the system can set theappropriate status for the requesting software thread. Furthermore, ifall the DMA resources are in use, then the requesting software threadmay have to wait until a DMA resource in the DMA resource pool 320 isfree.

In accordance with an embodiment of the invention, using the assignedthread key, the requesting software thread can further configure the DMAresource as it needs, after the resource has been assigned to thesoftware thread. For example, the requesting software thread can set thedescriptor properties (e.g. using a linked list instead of a ringstructure).

Additionally, a single software thread can make a request for multipleDMA resources if needed. The system can assign multiple DMA resources321-323 available in the free pool 320 to the requesting software threadbased on the same assigned thread key. Furthermore, the software threadcan decide whether it wants to maintain ordering between the multipleassigned resources once these DMA resources 321-323 are assigned. Forexample, the software thread can provide a dependency list to thehardware if ordering is required.

In accordance with an embodiment of the invention, the system allowsmultiple threads to concurrently access the DMA resources 321-323(including the packet buffers). By allowing each thread to have adifferent thread key, the system can send and receive packets from thenetwork fabric without a need for implementing mutex locks orsemaphores.

In accordance with an embodiment of the invention, the thread key spacecan be configured to include a large number of entries in order tosupport a large number of possible software threads. Thus, the systemcan map a large number of software threads to a limited set of hardwareresources.

FIG. 4 illustrates an exemplary flow chart for supporting efficientpacket processing in a network environment, in accordance with anembodiment of the invention. As shown in FIG. 4, at step 401, the systemcan provide a thread scheduling engine, wherein said thread schedulingengine operates to assign a thread key to each software thread in aplurality of software threads. Furthermore, at step 402, the system canprovide a pool of direct memory access (DMA) resources that operate toprocess packets in the network environment. Then, at step 403, each saidsoftware thread operates to request access to a DMA resource in the poolof DMA resources by presenting an assigned thread key.

Efficient Buffer Utilization for Packet Processing

FIG. 5 shows an illustration of supporting efficient buffer utilizationfor packet processing in a networking device, in accordance with anembodiment of the invention. As shown in FIG. 5, the DMA resources521-523 in a DMA resource pool 520 can be associated with one or morebuffer chains 531-533, each of which can contain various number ofpacket buffers in a networking device 500.

In accordance with an embodiment of the invention, when a DMA resourceis initialized, the DMA resource can point to an empty container, whichcan be used for containing packet buffers. Furthermore, the bufferchains 531-533 in the memory, where various packet buffers are placed,can be in the form of either a linked list or a linear array. Unlike afixed ring structure, the size of a buffer chain 531-533 can grow(subject to memory limits). Additionally, using the buffer chains531-533, the system allows for multi-threaded access to the queuingstructures.

As shown in FIG. 5, the software threads 501-509 can make a request foraccessing the packet buffers in the buffer chains 531-533, by presentingthe pre-assigned thread keys (such as key0 511 to key9 519). Forexample, the software thread 501 can access the packet buffers in thebuffer chain 531, using a pre-assigned thread key, key0 501. Also, thesoftware thread 502, can access the packet buffers in the buffer chain532, using a pre-assigned thread key, key1 512.

Furthermore, if a packet processing software thread needs to processmore than one set of buffer chains (e.g. in the case of scheduling asecond set of packet processing queues before the first set of packetprocessing queues are done), the requesting software thread can obtainand use another DMA resource out of the same hardware DMA resource pool520. As shown in FIG. 5, the software thread 501 can request to accessthe packet buffers in the buffer chain 533, using the same pre-assignedthread key, key0 501.

Additionally, if ordering is required among multiple packet processingprocesses, the system can set a resource dependency number as part ofthe configuration. The hardware processors can serialize the packetprocessing if the dependency list is set. Otherwise, the system mayprocess the packets in an arbitrary manner.

Furthermore, if a particular task requires potentially parallelprocessing by hardware threads and also requires the results to be sentout in order, then the system can dispatch the tasks to the DMA enginesthat have the dependency attribute set. Thus, the system can pipelinethe work and can make use of idle CPU time if it is available, inconjunction with allocating the DMA resources on demand.

In accordance with an embodiment of the invention, since each softwarethread 501-509 is pre-assigned with a thread key (such as key0 511 tokey9 519), the system can set up multiple threads to concurrent accessthe packet buffers in the different buffer chains 531-533, without aneed for implementing mutex locks or semaphores. This can be true forboth sending and receiving packets from the network fabric. Also, theabove scheme allows for packets to be pipelined in batches to thehardware either serially, or in parallel, when independent flows arebeing transmitted.

FIG. 6 shows an illustration of using buffer chains for packetprocessing in a networking device, in accordance with an embodiment ofthe invention. As shown in FIG. 6, a resource manager 610 can be used tomap a plurality of software threads 601-609 to different DMA resourcesin the free pool 620 in a networking device 600.

Each of the DMA resource in the free pool 620 can be associated with aresource ID, such as RID0 621, RID3 622, and RIDN 623. Furthermore, eachDMA resource can maintain a thread key, which can be used to access thedifferent buffer chains, and/or a thread ID, which can be used to assignand manage the different buffer chains.

For example, the software thread 0 601 (with a thread key key0 canpresent the thread key (key0) to the resource manager 610 in order torequest for allocating a DMA resource. The resource manager 610, inturn, can provide the thread key (key0) to an available DMA resource,e.g. RID0 621. Furthermore, if the thread 601 needs more hardwareresources, the resource manager 610 can provide the thread key (key0) toanother available DMA resource, e.g. RIDN 623.

Then, the resource manager 610 can provide the status of the DMAresources and all related resource numbers (e.g. RID0 621 and RIDN 623)back to the software thread 601. Thus, the software thread 0 601 canhave access to both chain of buffers 631-633 and 637-639, and candeallocate the related DMA resources after finishing packet processing.

Similarly, the software thread 1 602 (with a thread key key1) canpresent the thread key (key1) to the resource manager 610 in order torequest for allocating a DMA resource. The resource manager 610, inturn, can provide the thread key key1 to an available DMA resource, e.g.RID1 622. Thus, the software thread 0 601 can have access to the chainof buffers 634-636.

FIG. 7 shows an illustration of using one or more linked lists ofbuffers for packet processing in a networking device, in accordance withan embodiment of the invention. As shown in FIG. 7, a free DMA resourcespool 710 in a networking device 700 can maintain one or more DMAresources, each of which can be associated with several differentproperties, such as RID, Order, HeadAddr, and HeadLen. Here, the RIDproperty can contain a resource number assigned to a buffer chain, andthe Order property can indicate that a particular buffer chain isconfigured to be processed following another buffer chain.

As shown in FIG. 7, the system can use a linked-list data structure toimplement a buffer chain for holding various packets. For example, theDMA resource with a resource number 1 can point to a linked list ofpacket buffers, which starts at the packet buffer 711 with a headaddress h1. Here, the packet buffer 711 is collocated with a descriptor.Within the linked list, the packet buffer 711 can point to the nextpacket buffer 712 and the packet buffer 712 can point to the next packetbuffer 713, (each of the packet buffer 712 and the packet buffer 713 isalso collocates with a descriptor).

Additionally, the DMA resource with a resource number 2 can point to alinked list of packet buffers, which starts at a packet buffer 714 witha head address h2. Here, the packet buffer 714 is collocated with adescriptor and can point to another packet buffer 715.

Furthermore, the software thread accessing the DMA resource with aresource number 1 may make a request for accessing additional hardwareresources. For example, the software thread can access the DMA resourcewith a resource number 32, which points to linked list of packet buffersthat starts at a packet buffer 716 with a head address h32. Similarly,packet buffer 716 is collocated with a descriptor and can point to otherpacket buffers 717 and 718 in the linked list.

Also as shown in FIG. 7, the system can force the hardware to processthe packet buffers 711-713 before processing the packet buffers 716-718,by setting the Order value, for the DMA resource with a resource number32, to 1 (as shown as an arrow 720 pointing from the packet buffer 713to the packet buffer 716).

In accordance with an embodiment of the invention, using the schemebased on linked lists, the system can provide for a limited foot printin memory, which can be advantageous in the case of embedded systems.For example, the implementation of the linked list of packet buffers forthe Linux environment can be straight forward, since the Linuximplementation of packets is based on a linked list. Thus, the systemcan directly translate a linked list of packets in the Linux environmentinto a hardware linked list of packet buffers in the memory.

Furthermore, the implementation can be OS independent. For example, thesystem can be implemented on any general OS, custom OS, or embeddedRTOS.

FIG. 8 shows an illustration of using one or more linear arrays forsupporting packet processing in a networking device, in accordance withan embodiment of the invention. As shown in FIG. 8, a free DMA resourcespool 810 in a networking device 800 can maintain one or more DMAresources. Furthermore, each DMA resource can be associated with severaldifferent properties, such as RID, Order, HeadAddr, and HeadLen. Here,the RID property can contain a resource number assigned to a bufferchain, and the Order property can indicate that a particular bufferchain is configured to be processed following another buffer chain.

In accordance with an embodiment of the invention, the system can use alinear array of descriptors to implement a buffer chain for holdingvarious packets. Furthermore, each descriptor in the linear array ofdescriptors can point to a separate packet buffer, and the system canreach each packet buffer from a different packet descriptor.

As shown in FIG. 8, the DMA resource with a resource number 1 can pointto a linear array of descriptors 811 with a head address h2. Also, theDMA resource with a resource number 2 can point to a linear array ofdescriptors 812 with a head address h3. Here, the linear array ofdescriptors 811-812 is not collocated with the packet buffers.

Additionally, the system allows the packet buffers to be processedaccordingly to a pre-configured order. For example, the system can setthe Order value, for the DMA resource with resource number 3, to 2, inorder to force the hardware engine to process the packet buffersassociated with the linear array of descriptors 811 before the packetbuffers associated with the linear array of descriptors 812 (as shown asan arrow 820 pointing from the linear array of descriptors 811 to thelinear array of descriptors 812).

In accordance with an embodiment of the invention, the system can dealwith multiple packets in one shot without a need to deal with eachpacket separately in a sequence. Thus, using the linear array ofdescriptors, the system can provide low latency, which can beadvantageous, e.g. as a cache efficient scheme.

FIG. 9 shows an illustration of using a mix of linked lists and lineararrays to support flexible packet processing in a networking device, inaccordance with an embodiment of the invention. As shown in FIG. 9, afree DMA resources pool 910 in a networking device 900 can maintain oneor more DMA resources. Furthermore, each DMA resource can be associatedwith several different properties, such as RID, Order, HeadAddr,HeadLen, and Arrary/Linked. Here, the RID property can contain aresource number assigned to a buffer chain, and the Order property canindicate that a particular buffer chain is configured to be processedfollowing another buffer chain.

In accordance with an embodiment of the invention, the different DMAresources in the free pool 910 can be associated with different types ofbuffer chains.

For example, the DMA resource with a resource number 2 can point to alinear array of descriptors 911 with a head address h2, each of whichcan point to a packet. Similarly, the DMA resource with a resourcenumber 32 can point to a linear array of descriptors 912 with a headaddress h2, each of which can point to a packet.

Additionally, the DMA resource associated with a resource number 1 canpoint to a linked list of packet buffers, which start at the packetbuffer 913 with head address h1. Within the linked list data structure,the packet buffer 913, which collocates with a descriptor, can point toanother packet buffer 915. Similarly, the DMA resource associated with aresource number 32 can point to a linked list of packet buffers, whichstart at the packet buffer 917 with head address h32. Also, the packetbuffer 917, which collocates with a descriptor, can point to otherpacket buffers 918 and 919 in the linked list data structure.

Furthermore, the system allows the packet buffers to be processedaccording to a pre-configured order (as shown as an arrow 921 pointedfrom the linear array of descriptors 911 to the linear array ofdescriptors 912, and an arrow 922 pointing from the packet buffer 915 tothe packet buffer 917).

In accordance with an embodiment of the invention, the system candynamically determine which type of buffer chain can be allocated for arequesting software thread. Such a determination can be based on thebalance of memory usage and latency requirements of the particularpacket processing thread. For example, if a particular packet processingthread is more sensitive to memory usage, then the system can allocate alinked list based buffer chain. Otherwise, the system can allocate alinear array based buffer chain, when the particular packet processingthread is more sensitive to latency.

FIG. 10 illustrates an exemplary flow chart for supporting efficientbuffer utilization for packet processing in a networking device, inaccordance with an embodiment of the invention. As shown in FIG. 10, atstep 1001, the system can provide a plurality of packet buffers in amemory on the network device. Furthermore, at step 1002, the system canprovide a direct memory access (DMA) resources pool, wherein said DMAresource pool comprises one or more of DMA resources, wherein each saidDMA resource in said DMA resource pool points to a chain of packetbuffers in the memory. Then, at step 1003, each said DMA resource allowsa packet processing thread to access a chain of packet buffers in thememory using a thread key pre-assigned to the packet processing thread.

Many features of the present invention can be performed in, using, orwith the assistance of hardware, software, firmware, or combinationsthereof. Consequently, features of the present invention may beimplemented using a processing system (e.g., including one or moreprocessors).

Features of the present invention can be implemented in, using, or withthe assistance of a computer program product which is a storage medium(media) or computer readable medium (media) having instructions storedthereon/in which can be used to program a processing system to performany of the features presented herein. The storage medium can include,but is not limited to, any type of disk including floppy disks, opticaldiscs, DVD, CD-ROMs, microdrive, and magneto-optical disks, ROMs, RAMs,EPROMs, EEPROMs, DRAMs, VRAMs, flash memory devices, magnetic or opticalcards, nanosystems (including molecular memory ICs), or any type ofmedia or device suitable for storing instructions and/or data.

Stored on any one of the machine readable medium (media), features ofthe present invention can be incorporated in software and/or firmwarefor controlling the hardware of a processing system, and for enabling aprocessing system to interact with other mechanism utilizing the resultsof the present invention. Such software or firmware may include, but isnot limited to, application code, device drivers, operating systems andexecution environments/containers.

Features of the invention may also be implemented in hardware using, forexample, hardware components such as application specific integratedcircuits (ASICs). Implementation of the hardware state machine so as toperform the functions described herein will be apparent to personsskilled in the relevant art.

Additionally, the present invention may be conveniently implementedusing one or more conventional general purpose or specialized digitalcomputer, computing device, machine, or microprocessor, including one ormore processors, memory and/or computer readable storage mediaprogrammed according to the teachings of the present disclosure.Appropriate software coding can readily be prepared by skilledprogrammers based on the teachings of the present disclosure, as will beapparent to those skilled in the software art.

While various embodiments of the present invention have been describedabove, it should be understood that they have been presented by way ofexample, and not limitation. It will be apparent to persons skilled inthe relevant art that various changes in form and detail can be madetherein without departing from the spirit and scope of the invention.

The present invention has been described above with the aid offunctional building blocks illustrating the performance of specifiedfunctions and relationships thereof. The boundaries of these functionalbuilding blocks have often been arbitrarily defined herein for theconvenience of the description. Alternate boundaries can be defined solong as the specified functions and relationships thereof areappropriately performed. Any such alternate boundaries are thus withinthe scope and spirit of the invention.

The foregoing description of the present invention has been provided forthe purposes of illustration and description. It is not intended to beexhaustive or to limit the invention to the precise forms disclosed. Thebreadth and scope of the present invention should not be limited by anyof the above-described exemplary embodiments. Many modifications andvariations will be apparent to the practitioner skilled in the art. Themodifications and variations include any relevant combination of thedisclosed features. The embodiments were chosen and described in orderto best explain the principles of the invention and its practicalapplication, thereby enabling others skilled in the art to understandthe invention for various embodiments and with various modificationsthat are suited to the particular use contemplated. It is intended thatthe scope of the invention be defined by the following claims and theirequivalence.

What is claimed is:
 1. A system for supporting efficient packetprocessing in a network environment, the system comprising: a networkdevice comprising a microprocessor and a memory; a plurality of packetbuffers in the memory of the network device; a direct memory access(DMA) resource pool, wherein said DMA resource pool comprises one ormore DMA resources, and wherein each said DMA resource in said DMAresource pool points to a chain of packet buffers in the memory; athread scheduling engine operating on a network host machine thatpre-assigns different thread keys to each of a plurality of softwarethreads before each of the software threads requests access to the oneor more DMA resources; and a resource manager, which allocates DMAresources for use by the software threads, wherein a requesting softwarethread from the plurality of software threads requests access to a DMAresource by presenting its pre-assigned thread key to the resourcemanager, wherein the resource manager maps an assigned DMA resource tothe pre-assigned thread key associated with the requesting softwarethread; and wherein the assigned DMA resource enables the requestingsoftware thread to access a particular chain of packet buffers in thememory using the thread key pre-assigned to that software thread.
 2. Thesystem according to claim 1, wherein: said requesting software threadoperates to access multiple chains of packet buffers in the memory usingthe pre-assigned thread key.
 3. The system according to claim 2,wherein: said requesting software thread operates to set a dependencylist for processing packets in said multiple chains of packet buffers.4. The system according to claim 1, wherein: multiple requestingsoftware threads operate to access different chains of packet buffers inthe memory concurrently.
 5. The system according to claim 1, wherein: atleast one DMA resource points to a linked list of packet buffers.
 6. Thesystem according to claim 5, wherein: each packet buffer in the linkedlist collocates with a descriptor.
 7. The system according to claim 1,wherein: at least one DMA resource points to a linear array ofdescriptors.
 8. The system according to claim 7, wherein: eachdescriptor in a linear array of descriptors points to a packet buffer.9. The system according to claim 1, wherein: the plurality of packetbuffers are organized based on a mix of linked lists and linear arrays.10. The system according to claim 9, wherein: said DMA pool operates todynamically determine whether a software thread should access a chain ofpacket buffers based on a linked list or based on a linear array.
 11. Amethod for supporting efficient packet processing in a networkenvironment, comprising: providing a plurality of packet buffers in amemory on the network device; providing a direct memory access (DMA)pool, wherein said DMA resource pool comprises one or more DMAresources, and wherein each said DMA resource in said DMA resource poolpoints to a chain of packet buffers in the memory; pre-assigning, by athread scheduler operating on a network host machine, different threadkeys to each of a plurality of software threads before each of thesoftware threads requests access to the one or more DMA resources;receiving at a resource manager, from a requesting software thread fromthe plurality of software threads, a request to access a DMA resource,by the requesting software thread presenting its pre-assigned thread keyto the resource manager; allocating, by the resource manager, a DMAresource from the one or more DMA resources to the requesting softwarethread, including mapping an assigned DMA resource to the pre-assignedthread key associated with the requesting software thread; and allowing,via its assigned DMA resource, the requesting software thread to accessa particular chain of packet buffers in the memory using the thread keypre-assigned to that software thread.
 12. The method according to claim11, wherein: said requesting software thread accesses multiple chains ofpacket buffers in the memory using the pre-assigned thread key.
 13. Themethod according to claim 12 wherein: said requesting software threadsets a dependency list for processing packets in said multiple chains ofpacket buffers.
 14. The method according to claim 11, wherein: multiplerequesting software threads access different chains of packet buffers inthe memory concurrently.
 15. The method according to claim 11, wherein:at least one DMA resource points to a linked list of packet buffers. 16.The method according to claim 15, wherein: each packet buffer in thelinked list collocates with a descriptor.
 17. The method according toclaim 11, wherein: at least one DMA resource points to a linear array ofdescriptors.
 18. The method according to claim 17, wherein: eachdescriptor in the linear array of descriptors points to a packet buffer.19. The method according to claim 11, further comprising: organizing theplurality of packet buffers based on a mix of linked lists and lineararrays, and dynamically determining whether a software thread shouldaccess a chain of buffers based on a linked list or based on a lineararray.
 20. A non-transitory machine readable storage medium havinginstructions stored thereon that when executed cause a system to performthe steps comprising: providing a plurality of packet buffers in amemory on the network device; providing a direct memory access (DMA)pool, wherein said DMA resource pool comprises one or more DMAresources, wherein each said DMA resource in said DMA resource poolpoints to a chain of packet buffers in the memory; pre-assigning, by athread scheduler operating on a network host machine, different threadkeys to each of a plurality of software threads before each of thesoftware threads requests access to the one or more DMA resources; andreceiving at a resource manager, from a requesting software thread fromthe plurality of software threads, a request to access a DMA resource,by the requesting software thread presenting its pre-assigned thread keyto the resource manager; allocating, by the resource manager, a DMAresource from the one or more DMA resources to the requesting softwarethread, including mapping an assigned DMA resource to the pre-assignedthread key associated with the requesting software thread; and allowing,via its assigned DMA resource, the requesting software thread to accessa particular chain of packet buffers in the memory using the thread keypre-assigned to that software thread.